import React, { Component } from "react";

export default class ClassCom extends Component {
  state = { num: 0 };
  handleClick = () => {
    this.setState({ num: this.state.num + 1 });
  };
  render() {
    return (
      <div>
        <div>类组件：</div>
        <span>{this.state.num}</span>
        <button onClick={this.handleClick}>+</button>
      </div>
    );
  }
}
